﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ActivitySystemDefaultPage.Master" AutoEventWireup="true" CodeBehind="TypeList.aspx.cs" Inherits="ActivitySystem.Web.Activity.TypeList" %>

<%@ Register Assembly="Sunyi.Project.WebPoint.WebControl" Namespace="Sunyi.Project.WebPoint.WebControl" TagPrefix="cc1" %>
<asp:Content ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .div_search_result table
        {
            border: 1px;
        }
        .div_content_searchbar input
        {
            width: 95px;
        }
        .div_content_searchbar span
        {
            margin: 2px;
        }
    </style>
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" runat="server">
    
    <asp:ScriptManager ID="scriptManager" runat="server" />
    <asp:UpdatePanel ID="updatePanel" runat="server">
        <ContentTemplate>
            <div id="div_content_searchbar">
                <span>Type Name:</span><asp:TextBox ID="tbxTypeName" runat="server" />
                <span>Status:</span><asp:DropDownList ID="ddlStatus" runat="server">
                    <asp:ListItem Value="True">Enable</asp:ListItem>
                    <asp:ListItem Value="False">Disable</asp:ListItem>
                </asp:DropDownList>
                <asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click" />
                <asp:Literal ID="litCreateNew" runat="server"><a href='TypeEdit.aspx?Mode=Create' target="_blank">Add New</a></asp:Literal>
            </div>
            <div class="div_search_result" style="margin-top: 5px;">
                <cc1:PagingGridView ID="gvType" runat="server" AutoGenerateColumns="False" AllowPaging="True" OnPageIndexChanging="gvType_PageIndexChanging" PageSize="20" Width="100%">
                    <Columns>
                        <asp:TemplateField HeaderText="Type Name">
                            <ItemTemplate>
                                <a href='TypeEdit.aspx?TypeId=<%# Eval("Id")%>&Mode=Read' target="_blank">
                                    <%# Eval("Name")%></a>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Description">
                            <ItemTemplate>
                                    <%# Eval("Description").ToString().Length > 50 ? Eval("Description").ToString().Substring(0, 50)+"..." : Eval("Description").ToString()%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Status">
                            <ItemTemplate>
                                <%# Eval("IsActive").ToString() =="True" ? "Enable" : "Disable" %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Edit">
                            <ItemTemplate>
                                <a href='TypeEdit.aspx?TypeId=<%# Eval("Id") %>&Mode=Update' target="_blank">Edit</a>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle BackColor="#546E96" ForeColor="#DFDFDF" />
                </cc1:PagingGridView>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
